package com.an.blog.third.es.domain;

import lombok.Data;
import org.dromara.easyes.annotation.HighLight;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * ES博客文章
 *
 * @author: Ann
 * @createDate: 2024/03/05
 * @version: 1.0.0
 */
@Data
@IndexName(value = "blog_article")
public class EsBlogArticle implements Serializable {

    private static final long serialVersionUID = -1929456872939329729L;

    @IndexId
    private Long articleId;

    /**
     * 文档标题
     */
    @IndexField(fieldType = FieldType.TEXT,
        analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
    @HighLight(preTag = "<text style='color:red;background-color: yellow;font-weight: bold;'>",postTag = "</text>")
    private String articleTitle;

    /**
     * 文档内容
     */
    @IndexField(fieldType = FieldType.TEXT,
        analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
    @HighLight(preTag = "<text style='color:red;background-color: yellow;font-weight: bold;'>",postTag = "</text>")
    private String articleContent;

    /**
     * 文章图片
     */
    private String articleImage;

    private String status;

    /**
     * 是否置顶（0否 1是）
     */
    private Integer isTop;

    /**
     * 文章类型（0原创 1转载 2翻译）
     */
    private String articleType;
    /**
     * 原文链接
     */
    private String originalUrl;

    /**
     * 文章标签
     */
    private String[] tags;

    /**
     * 分类名称
     */
    private String categoryName;

    /**
     * 作者 ID
     */
    private Long authorId;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 创建时间
     */
    private Date createTime;


}
